from functools import wraps

class logit():
	def __init__(self,logfile = 'out.log'):
		print('__init__被调用')
		self.logfile = logfile

	def __call__(self,func):
		print('__call__被调用')
		@wraps(func)
		def wrapped_function(*args,**kwargs):
			print('wrapped_function被调用')
			log_string = func.__name__ + " was called"
			print(log_string)
			with open(self.logfile,'w') as opened_file:
				opened_file.write(log_string)
			return func(*args,**kwargs)
			self.notify()
			return func(*args,**kwargs)
		return wrapped_function
	def notify(self):
		pass

class email_logit(logit):
    def __init__(self,email = 'admin@126.com',*args,**kwargs):
    	self.email = email
    	super(email_logit,self).__init__(*args,**kwargs)

    def notify(self):
    	pass


@logit()
def myfunc1():
	pass

myfunc1()